home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / FLIPROT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.7 KB  |  92 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // FLIVideoProtect
  8. //
  9.  
  10. #ifndef __BCPLUSPLUS__
  11. #pragma inline
  12. #endif
  13.  
  14. #include "fli.h"
  15.  
  16. #ifdef __BCPLUSPLUS__
  17. #pragma hdrstop
  18. #endif
  19.  
  20. #define I asm
  21.  
  22. int FLIVideoProtect = 0;
  23.  
  24. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  25. //
  26. // _FLIVideoProtect class (defined in FLI.H)
  27. //
  28. // This class ensures that the cursor, video mode, and video hardware are
  29. // all returned to the status that they were in before your program began.
  30. //
  31. // To use this class just include "FLIVideoProtect++" anywhere in your
  32. // program modules and it will be linked in and used automatically.
  33. //
  34. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  35.  
  36. static BlazeClass Blaze;
  37.  
  38. _FLIVideoProtect::_FLIVideoProtect()
  39. {
  40.   I mov ah,3
  41.   I mov bh,0
  42.   I int 10h
  43.  
  44.   TopCursor = _CH;
  45.   BottomCursor = _CL;
  46.  
  47.   I mov ah,0fh
  48.   I int 10h
  49.  
  50.   DisplayMode = _AL;
  51.  
  52.   if ((DisplayMode==2 || DisplayMode==3 || DisplayMode==7)
  53.     && (Blaze.WhatHeight()==43 || Blaze.WhatHeight()==50))
  54.   {
  55.     OtherEGAVGA=EGA_VGA_43or50;
  56.     Height=Blaze.WhatHeight();
  57.   }
  58.   else
  59.   {
  60.     OtherEGAVGA=0;
  61.     Height=0;
  62.   }
  63.  
  64.   return;
  65. }
  66.  
  67. _FLIVideoProtect::~_FLIVideoProtect()
  68. {
  69.   MouseShutDown();
  70.  
  71.   I mov ah,1
  72.   _CH = TopCursor;
  73.   _CL = BottomCursor;
  74.   I int 10h
  75.  
  76.   I mov ah,0fh
  77.   I int 10h
  78.  
  79.   if (_AL!=DisplayMode || (!OtherEGAVGA && Height!=Blaze.WhatHeight()))
  80.     Blaze[((!OtherEGAVGA)?DisplayMode:OtherEGAVGA)];
  81.  
  82.   if (Blaze.Intense)
  83.     Blaze.ToggleIntense();
  84.  
  85.   -Blaze;
  86.   Blaze.GotoXY(0,0);
  87.  
  88.   return;
  89. }
  90.  
  91. _FLIVideoProtect _FLI_VideoProtectionFeature;
  92.